﻿using jbt.CodeCandy.AsTrEAM.Contracts;
using System;
using System.Threading.Tasks;

namespace jbt.CodeCandy.AsTrEAM
{
    /// <summary>
    /// Allows an object to manage streams.
    /// </summary>
    public interface IStreamManager
    {
        /// <summary>
        /// Creates a stream.
        /// </summary>
        /// <param name="streamData">
        /// Describes the stream to be created.
        /// </param>
        /// <returns>
        /// The result of operation.
        /// </returns>
        /// <exception cref="ArgumentNullException">
        /// <paramref name="streamData"/> is null.
        /// </exception>
        /// <exception cref="StreamManagerException">
        /// Stream couldn't be created.
        /// </exception>
        Task<NewStreamResult> Create(StreamData streamData);

        /// <summary>
        /// Returns the requested stream.
        /// </summary>
        /// <param name="id">
        /// The unique identifier of stream to return.
        /// </param>
        /// <returns>
        /// The stream with the specified identifier.
        /// </returns>
        /// <exception cref="ArgumentException">
        /// <paramref name="id"/> is null or white space.
        /// </exception>
        /// <exception cref="StreamManagerException">
        /// Stream couldn't be read.
        /// </exception>
        Task<StreamData> Get(string id);
    }
}